<?php 
include "includes/session.php";
include "includes/comunes.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sistema de Seguimiento de Presupuestos</title>

<link href="estilos.css" rel="stylesheet" type="text/css" />
<script src="jquery-ui/js/jquery-1.9.1.js"></script>
<!--fin libreria central-->

<!--Librerias para el combo-->
<script language="JavaScript" type="text/javascript" src="combos/jquery.chainedSelects.js"></script>
<!--fin libreria-->

<!--librerias ui-->
<link href="jquery-ui/css/ui-lightness/jquery-ui-1.10.2.custom.css" rel="stylesheet"/>
<script src="jquery-ui/js/jquery-ui-1.10.2.custom.js"></script>
<!--fin libreria-->
<!--libreria flexigrid-->
<link rel="stylesheet" type="text/css" href="jquery-ui/css/ui-flexigrid/flexigrid.css">
    <script type="text/javascript" src="jquery-ui/js/flexigrid.js"></script>
<!--fin libreria-->
<!--VENTANA MODAL -->
<link href="modal/styles/modal-window.css" type="text/css" rel="stylesheet" /> 
 
<script type="text/javascript" language="javascript" src="modal/scripts/modal-window.min.js"></script>  
<style>
 
  body{
  background: white;
  }
  </style>
</head>

<body>




      
       <div class="contenedorpedido">
   
		<?php 
		$sqlDet="select * from presu_presu_detalle where DetPresu=".$_GET['pre_id']." order by DetItem asc";
		//echo $sql;
		$resDet=cons_sql_up($sqlDet);
		$tot=0;
		if(mysql_num_rows($resDet)>0):
		?>
		
		<fieldset>
             <legend><b>Detalle</b></legend>
			 <table width='100%'>
                 <tr>
					<td class="textotablamenuform">Item</td>
					<td class="textotablamenuform">Producto</td>
					<td class="textotablamenuform">Cant.</td>
					<td class="textotablamenuform">PU</td>
					<td class="textotablamenuform">PT</td>
				 </tr>
				 <?php while($regDet=mysql_fetch_array($resDet)):?>
				  <tr>
					<td class="textotablamenuform"><?php echo $regDet['DetItem']?></td>
					<td class="textotablamenuform"><?php echo $regDet['DetCodigo']?> <?php echo $regDet['DetcodDescripcion']?></td>
					<td class="textotablamenuform"><?php echo $regDet['DetCantidad']?></td>
					<td class="textotablamenuform">$ <?php echo $regDet['DetPrecioUnitario']?></td>
					<td class="textotablamenuform">$ <?php echo $regDet['DetPrecioTotal']?></td>
				 </tr>
				 <?php 
				 $tot=$tot+$regDet['DetPrecioTotal'];
				 endwhile?>
				 <tr>
					<td class="textotablamenuform"></td>
					<td class="textotablamenuform"></td>
					<td class="textotablamenuform"></td>
					<td class="textotablamenuform" style="color:green">TOTAL SIN IVA</td>
					<td class="textotablamenuform" style="color:green">$ <?php echo round($tot,2) ?></td>
				 </tr>
				  <tr>
					<td class="textotablamenuform"></td>
					<td class="textotablamenuform"></td>
					<td class="textotablamenuform"></td>
					<td class="textotablamenuform" style="color:red">TOTAL CON IVA</td>
					<td class="textotablamenuform" style="color:red">$ <?php echo round(($tot*1.21),2)?></td>
				 </tr>
            </table>
       </fieldset>
	<?php else:?>
	   <table width='100%'>
                 <tr>
					<td class="textotablamenuform">No existen registros para este pedido</td>
				</tr>
       </table>
    <?php endif?>
</body>
</html>
